package physicsModeler.tests;

import java.util.Vector;

import physicsModeler.ObjectFactory;
import physicsModeler.objects.DrawObject;
import junit.framework.TestCase;

public class ObjectFactoryTest extends TestCase {

	public ObjectFactoryTest(String name) {
		super(name);
	}

	public void testGetShapeNames() 
	{
		ObjectFactory objectFactory = new ObjectFactory();
		DrawObject drawObject = null;
		
		try {
			drawObject = (DrawObject)objectFactory.createDrawObject("Ball");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		assertTrue(drawObject.getName()=="Ball");
	}
	
	public void testLoadClasses()
	{
		ObjectFactory objectFactory = new ObjectFactory();
		int count = 7;
		Vector shapeNames = objectFactory.getShapeNames();
		assertTrue(shapeNames.size() == count);
	}

}
